<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>${config.siteName}</title>
    <link href="/assets/images/favicon11.ico" rel="shortcut icon" type="image/x-icon">
    <link href="/assets/plugins/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="/assets/plugins/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="/assets/css/jquery-confirm.min.css" rel="stylesheet">
    <link href="/assets/plugins/fancybox/jquery.fancybox.min.css" rel="stylesheet">
    <link href="/assets/plugins/icheck-1.x/skins/square/green.css" rel="stylesheet">
    <link href="/assets/plugins/zTree_v3/css/metroStyle/metroStyle.css" rel="stylesheet">
	<link href="/assets/plugins/bootstrap-fs-modal/dist/css/fs-modal.min.css" rel="stylesheet">
    <link href="/assets/css/yyl.core.css" rel="stylesheet">
</head>
<body class="nav-md">
	<div class="container body">
		<div class="main_container">
			<div class="modal fade" id="modal" tabindex="-1" role="dialog"
				aria-labelledby="myModalLabel" aria-hidden="true"
				data-backdrop="static" data-keyboard="false">
				<div class="modal-dialog" role="document">
					<div class="modal-content">
						<div class="modal-body">
							<div class="login_wrapper">
								<div class="animate form login_form" style="position: relative;">
									<section class="login_content">
										<form action="/auth/signin" method="POST" id="login-form">
											<h1>登录-${licence.username}</h1>
											<#if message?exists>
											<div class="alert alert-danger" role="alert">
												${message?if_exists}</div>
											</#if>
											<div>
												<input type="text" class="form-control" placeholder="请输入用户名"
													name="username" required="required" autocomplete="off" />
											</div>
											<div>
												<input type="password" class="form-control"
													placeholder="请输入密码" name="password" required="required" />
											</div>
											<#if enableKaptcha?exists && enableKaptcha>
											<div class="form-group col-xs-6" style="padding-left: 0px;">
												<img alt="点击获取验证码" id="img-kaptcha" src="/getKaptcha"
													style="cursor: pointer; height: 34px; width: 180px;">
											</div>
											<div class="form-group col-xs-6">
												<span><input type="text" class="form-control"
													placeholder="验证码" id="kaptcha" name="kaptcha"></span>
											</div>
											</#if>
											<div class="form-group" style="text-align: left">
												<label><input type="checkbox" id="rememberMe"
													name="rememberMe"
													style="width: 12px; height: 12px; margin-right: 5px;">
													记住我</label>
											</div>
											<div>
												<button type="button" class="btn btn-success btn-login"
													style="width: 100%;">登录</button>
											</div>
											<div class="login-loading hide">
												<i class="fa fa-spinner fa-pulse"></i>正在登录中...
											</div>

											<div class="clearfix"></div>

											<div class="separator">
												<div class="clearfix"></div>
												<div>
													<h1>
														<i class="fa fa-coffee"></i> ${licence.productname}
													</h1>
													<p>Copyright © ${.now?string["yyyy"]}
														${licence.copyright}. All Rights Reserved.</p>
												</div>
											</div>
										</form>
									</section>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>


	<script src="/assets/js/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="/assets/plugins/bootstrap-3.3.7/js/bootstrap.min.js" type="text/javascript"></script>
<script src="/assets/js/jquery-confirm.min.js" type="text/javascript"></script>
<script src="/assets/plugins/icheck-1.x/icheck.min.js"></script>

<script src="/assets/js/validator.js"></script>
<script src="/assets/js/yyl.tool.js"></script>
<script src="/assets/js/yyl.core.js"></script>
<script src="/assets/js/yyl.table.js"></script>

    <script>
        $("#modal").modal('show');
        $(".btn-login").click(function () {
            $(".login-loading").removeClass("hide");
            $.ajax({
                type: "POST",
                url: "/auth/signin",
                data: $("#login-form").serialize(),
                dataType: "json",
                success: function (json) {
                    $(".login-loading").addClass("hide");
                    if (json.status == 200) {
                        window.location.href = "/";
                    }else{
                        $.alert.error(json.message);
                        $("#img-kaptcha").attr("src", '/getKaptcha?time=' + new Date().getTime());
                    }
                }
            });
        });
        $("#img-kaptcha").click(function () {
            $(this).attr("src", '/getKaptcha?time=' + new Date().getTime());
        });
        document.onkeydown = function (event) {
            var e = event || window.event || arguments.callee.caller.arguments[0];
            if (e && e.keyCode == 13) {
                $(".btn-login").click();
            }
        };
    </script>
    
    

    </body>
</html>

